package com.github.natholdallas.controller.copilot

import com.github.natholdallas.common.Gender
import com.github.natholdallas.common.Role
import com.github.natholdallas.database.User
import com.github.natholdallas.declaration.ModelSerializer

data class UserIn(
    val name: String?,
    val avatar: String?,
    val description: String?,
    val gender: Gender,
    val phone: String?,
    val qrcode: String?,
) : ModelSerializer<User> {
    override fun get() = User(
        role = Role.COPILOT,
        name = name,
        avatar = avatar,
        description = description,
        gender = gender,
        phone = phone,
        qrcode = qrcode
    )

    override fun set(v: User) {
        v.role = Role.COPILOT
        v.name = name
        v.avatar = avatar
        v.description = description
        v.gender = gender
        v.phone = phone
        v.qrcode = qrcode
    }
}
